{extend name='../app/admin/view/common/pop.html' /}
{block name="content"}
    <form class="layui-form j-form" style="margin-top: 15px" id="form">
       {php} echo $html;{/php}
        <div class="layui-form-item">
            <div class="layui-form-label"></div>
            <div class="layui-input-inline">
                <button class="layui-btn layui-btn-normal" lay-submit  lay-filter="create">提交</button>
            </div>
        </div>
    </form>
{/block}

{block name="script"}
<script>
    layui.use(['layer','form','jquery'],function(){
        var layer = layui.layer,
            form = layui.form,
            $ = layui.jquery;
        form.render();

        form.on('submit(create)',function(data){
            var fd = new FormData(document.getElementById("form"));
            $.ajax({
                url:"{:plugin_url()}",
                type:'post',
                processData: false,//必须
                contentType: false,//必须
                data:fd,
                success:function(r){
                    layer.msg(r.msg);
                    if (r.code == 1) {
                        setTimeout(function(){
                            parent.location.reload();
                        },1000)
                    }
                },
                error:function(r){
                    layer.msg(r.msg);
                }
            });
            return false;
        })
    })

</script>
{/block}